Support Web3signer distroless#2559
Conversation
c34ef65 to
f87bb03
Compare
abac0c9 to
52bb597
Compare
52bb597 to
ec4d8df
Compare
ec4d8df to
e7b185d
Compare
e7b185d to
f803d47
Compare
| W3S_READ_ONLY=false | ||
| W3S_DOCKER_REPO=consensys/web3signer | ||
| # Use Dockerfile.custom-network for a custom devnet NETWORK. Doesn't support distroless. | ||
| W3S_DOCKERFILE=Dockerfile.slim |
There was a problem hiding this comment.
Probably rather uncommon that people have custom networks. But this will break those setups right (until they explicitly change this value to Dockerfile.custom-network)
There was a problem hiding this comment.
Correct. I had a choice of breaking it entirely or gating it behind this change. I asked Consensys whether they use the feature. They do not. It's a feature that Pandaops had asked for on behalf of client teams, and I am now unsure whether any client teams use it.
It'd be used for stuff like "devnet3"
There was a problem hiding this comment.
On further thought. You likely can't even run a custom devnet with an image, it'd need to be source-built. Which means no one is using this feature
There was a problem hiding this comment.
I've added a Dockerfile.source for this use case
| - /etc/localtime:/etc/localtime:ro | ||
| read_only: ${W3S_READ_ONLY:-false} | ||
| environment: | ||
| - JAVA_OPTS=${W3S_HEAP:--Xmx6g} |
There was a problem hiding this comment.
Apparently this does not work with 'distroless' (according to Codex at least).
The web3signer script in the original image did
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $WEB3SIGNER_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
But distroless does not.
Can set JAVA_TOOL_OPTIONS instead, but... only for distroless? Or also for regular image?
There was a problem hiding this comment.
read_only is a Docker option. This absolutely works. So well in fact they had to fix Web3signer-distroless because it'd break when I turned that on: Consensys/web3signer#1175
There was a problem hiding this comment.
AH ok, JAVA_OPTS. Yeah this likely doesn't work in distroless. We can point that out to Consensys as a bug
There was a problem hiding this comment.
Let's leave that for another PR. JAVA_TOOL_OPTIONS is a good choice; we'd need to verify it doesn't interfere with what regular web3signer is doing
ad4e08d to
7be65f7
Compare
7be65f7 to
618aa14
Compare
What I did
Consensys introduced a
latest-distrolesstag. This supports it.Requires Web3signer 26.4.2 or later
The migration warnings and failures have migrated into
w3s-initDockerfile.binaryis the default and will just run the entrypoint of whatever image the user choosesDockerfile.sourcestill supports custom network processingAdd Web3signer CI